package com.city.repository.report;

import com.city.domain.report.CtEvent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CtEventRepository extends JpaRepository<CtEvent,Integer> {

    @Query(value =  "SELECT * FROM ct_event WHERE " +
                    "category_id = ?1 AND " +
                    "parent = ?2"
                    ,nativeQuery = true)
    List<CtEvent> findAllByCategoryIdAndParent(Integer categoryId, Integer parent);
}
